#include <iostream>
using namespace std;
#define maxn 100000
int K;
int arr[maxn];
int flag = -1;
int main()
{

    cin >> K;
    for (int i = 0, tmp = 0;; i++)
    {
        cin >> tmp;
        if (tmp < 0)
            break;
        arr[i + K - 1] = tmp;
        flag++;
    }
    if (flag < 0 || arr[flag] == 0)
        cout << "NULL";
    else
        cout << arr[flag];

    return 0;
}